import React, { Component } from 'react';

import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom'
import { setEquipListData } from '@/store/action/equip';
import ListView from '@/components/ListView'
import Item from './ui/Item'

// 引入搜索区域
import SearchNav from '@/components/SearchNav'
//引入内容区域
import Main from './ui/Main'
// 引入列表区域
import List from './ui/List'
// 引入样式

// import { Searchshow } from './ui/style';
// import { Container } from './ui/style';
// import { Listshow } from './ui/style';

// @connect ( state=> ({equipListData: state.getIn(['equip','EquipListData']).toJS()}),{setEquipListData})
@connect(state => {
  return{
    equipListData: state.getIn(['equip', 'EquipListData']).toJS() 
  }
}, { setEquipListData })
@withRouter

class index extends Component {

  componentDidMount(){
    // this.props.setEquipListData()
    this.props.setEquipListData()
  }
  render() {
    // console.log("data",this.props.equipListData)

    return (
      <div className='page'>
        {/* 搜索框 */}
        <SearchNav />


        {/* 内容区域 */}
        <Main />

        {/* 列表区域 */}
        <ListView
        item= {Item}
        data= {this.props.equipListData}
        getData= {(page=1) => this.props.setEquipListData({
          page,
          page_size: 30,
        })}
        />
        {/* <List data={this.props.equipListData}/> */}
      </div>
    );
  }
}

export default index;
